import {takeEvery, put} from 'redux-saga/effects'
import axios from 'axios'

function* loadPerson() {
  console.log('saga,getList调用了', '=========')
  let persons = yield axios.get('http://localhost:3000/api/person.json').then(res => res.data)
  yield put({type: 'getListSuccess', payload: persons})
}

export default function* personSaga () {
  yield takeEvery('getListAction', loadPerson)
}